package letsjava.rmi;

import java.rmi.*;
import javax.naming.*;

public class WarehouseServer {
	public static void main(String[] args) throws RemoteException, NamingException{
		//System.setProperty("java.security.policy","server.policy");
		//System.setSecurityManager(new SecurityManager());
		
		System.out.println("constract rmi server make sure you have run rmiregistry in other window");
		WarehouseImpl wImpl = new WarehouseImpl();
		
		wImpl.add("pear", new Product("pear",1.11));
		wImpl.add("apple", new Book("mac","this is a mac",1.11));
		
		Context context = new InitialContext();
		context.bind("rmi://127.0.0.1/warehouse", wImpl);
		
		
		
	}
}
